package cn.pfz.domain;


import cn.pfz.statusnum.ConsumptionStatusEnum;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class Consumption extends ConsumptionKey {
    private String cno;

    private Integer status;

    private BigDecimal total_amount;

    private BigDecimal pay_amount;

    private BigDecimal discount_amount;

    private String info;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date pay_time;

//    private Long payee_id;
    private Employee payee;

    private String customer_name;

    private String customer_tel;

    private String car_licence;

    private String car_type;

    private String appointment_ano;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date checkin_time;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date checkout_time;

//    private Long business_id;
    private Business business;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date create_time;

//    private Long create_user_id;
    private Employee create_user;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date audit_time;

//    private Long auditor_id;
    private Employee auditor;

    public String getStatusName(){
        return ConsumptionStatusEnum.getName(this.status);
    }

}